using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using System.IO;
using System.Drawing;
using System.Net;
using FasGUI;
using System.Drawing.Imaging;

namespace FAS.App_Code
{
    public class ImageManipulator
    {
        public static bool banderaMedia = false;

        public static Image getImageFromScreen(RichTextBox txt)
        {
            int x = txt.Bounds.X;
            int y = txt.Bounds.Y + 40;
            Rectangle rect = new Rectangle(x, y, txt.Width, txt.Height);
            Bitmap bmp = new Bitmap(rect.Width, rect.Height, PixelFormat.Format32bppArgb);
            Graphics g = Graphics.FromImage(bmp);
            g.CopyFromScreen(rect.Left, rect.Top, 0, 0, bmp.Size, CopyPixelOperation.SourceCopy);
            return bmp;
        }

        public static void generarImagenes(RichTextBox rich, String name)
        {
            Image image = getImageFromScreen(rich);
            image.Save(name);
        }


    }
}
